package com.neusoft.controller.physician;

import com.neusoft.service.CheckRequestService;
import com.neusoft.service.InspectionRequestService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;
import java.util.Map;

@RestController
@RequestMapping("/inspectionrequests")
//@CrossOrigin
public class InspectionRequestController2 {


    @Autowired
    private InspectionRequestService inspectionRequestService;

    @PostMapping("/saveInspectionRequest")
    public String saveCheckRequest(@RequestBody Map<String,Object> inspectionRequest){

        inspectionRequest.put("creation_time", LocalDateTime.now());
        return inspectionRequestService.saveInspectionRequest(inspectionRequest);
    }
}
